<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
<script type="text/javascript">
function  onLoad(){
	if(parseInt("${result}")>0){
		alert("保存成功");
	}else if(parseInt("${result}")<0){
		alert("保存失败");
	}
	
}

function  goBack(){
	window.history.back(-1);
}

function save(){
	var str_data=$("#styleform input").map(function(){
		   return ($(this).attr("name")+'='+$(this).val());
		 }).get().join("&") ;
    $.ajax({
        url:"${ctx}/appFrameStyle/updateAppFrameStyle",
        type: "POST",      
        dataType:"json",
        data: str_data,
        async: false,
        success: function(data) {
        	if(data.flag>0){
	            alert("保存成功！");	
	            window.location.reload();
        	}
/* 	          $.each(data, function(index, element) {
             window.location.reload();
          }); */
        },
        error: function() {
          alert("error");
        }
      });
	
}

function  changeValue(styleValue){
	   document.getElementById("app_style").value=styleValue;	
}
</script>
</head>
<body  onload="onLoad()">
<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">
          App风格设置信息
      </h3>
   </div>
   <div class="panel-body">
<form class="form-horizontal" role="form"  id="styleform"   action="${ctx}/appFrameStyle/updateAppFrameStyle"  method="post">
      <div class="form-group">
		<label for="APP_ID" class="col-xs-2 control-label">移动应用标识</label>
		<div class="col-xs-4">
		<input type="text" class="form-control" id="APP_ID"  name="appId"    value="${appFrameStyle.appId}"    placeholder="APP_ID" readonly="readonly" >
	    </div>
	    <label for="app_style" class="col-xs-2 control-label">APP风格</label>
<%-- 		<div class="col-xs-4">
		<input type="text" class="form-control" id="app_style" name="appStyle"  value="${appFrameStyle.appStyle}" placeholder="app_style">
	    </div> --%>
	    <div class="col-xs-4">
	      <input type="hidden" class="form-control" id="app_style" name="appStyle"  value="${appFrameStyle.appStyle}" placeholder="app_style">
	      <select class="form-control" id="appStyle" name="appStyle"  onclick="changeValue(this.value)">
<%-- 	         <option value="0">${appModuleParam.isMustNeed}</option> --%>
                     <c:choose>
			             <c:when  test="${appFrameStyle.appStyle=='01'}">
                              <option value="01"  selected="selected">经典风格</option>        
			             </c:when >
			             <c:otherwise> 
	                          <option value="01">经典风格</option>
                         </c:otherwise>
                       </c:choose>
                     <c:choose>
                         <c:when  test="${appFrameStyle.appStyle=='02'}">
                              <option value="02"  selected="selected">侧滑风</option>        
			             </c:when >
			             <c:otherwise> 
	                          <option value="02">侧滑风</option>
                         </c:otherwise>
                       </c:choose>

<%--              <c:if test="${appFrameStyle.appStyle=='01'}">
                <option value="01"  selected="selected">经典风格</option>        
            </c:if>
            <c:if test="${appFrameStyle.appStyle=='02'}">
                <option value="02"  selected="selected">侧滑风</option>        
            </c:if> --%>
<!-- 	          <option value="01">经典风格</option>
	           <option value="02">侧滑风</option> -->
	      </select>
	    </div>
	  </div>  
	  <div class="form-group">
         <div class="col-xs-offset-2 col-xs-10">
         <button type="button" class="btn btn-default"  onclick="save();">保存</button>
         <button type="button" class="btn btn-default"   onclick="goBack();">返回</button>
         </div>
      </div>
</form>
   </div>
</div>
<%@ include file="/page/foot.html" %>
